<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/5/4 0004
  Time: 21:26
  To change this template use File | Settings | File Templates.
--%>
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<input type="text" value="${pageIndex}" hidden id="pageIndex">
<input type="text" value="${pageCount}" hidden id="pageCount">
<input type="text" value='${jsonObject}' hidden id="jsonObject">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend style="font-size: 14px;">
        <form class="layui-form" method="post" action="querylist" name="search">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <select  name="couponsVo.type" id="couponstype">
                        <option value="">优惠券类型</option>
                        <c:forEach items="${SysDict['cropons_type']}" var="type">
                            <c:if test="${recouponsVo.type==type.key}">
                                <option value="${type.key}" selected>${type.value}</option>
                            </c:if>
                            <c:if test="${recouponsVo.type!=type.key}">
                                <option value="${type.key}">${type.value}</option>
                            </c:if>
                        </c:forEach>
                    </select>
                </div>&nbsp;
                <div class="layui-input-inline">
                    <select  name="couponsVo.status" id="customerstatus">
                        <option value="">优惠券状态</option>
                        <c:forEach items="${SysDict['cropons_status']}" var="status">
                            <c:if test="${recouponsVo.status==status.key}">
                                <option value="${status.key}" selected>${status.value}</option>
                            </c:if>
                            <c:if test="${recouponsVo.status!=status.key}">
                                <option value="${status.key}">${status.value}</option>
                            </c:if>

                        </c:forEach>
                    </select>
                </div>&nbsp;
                <div class="layui-input-inline">
                    <input name="couponsVo.description"  lay-verify="" autocomplete="off" value="${recouponsVo.description}"
                           placeholder="请输入关键词" class="layui-input" type="text">
                </div>&nbsp;

                <div class=" layui-inline">
                    <label class="layui-form-label">价值范围</label>
                    <div class="layui-input-inline" style="width: 100px;">
                        <input value="${recouponsVo.startvalue}" name="couponsVo.startvalue" class="layui-input"
                               placeholder="起始价值" type="text">
                    </div>
                    <div class="layui-form-mid">:</div>
                    <div class="layui-input-inline" style="width: 100px;">
                        <input value="${recouponsVo.endvalue}" name="couponsVo.endvalue" class="layui-input"
                               placeholder="结束价值" type="text">
                    </div>
                </div>&nbsp;


                <div class=" layui-inline">
                    <label class="layui-form-label">截止日期</label>
                    <div class="layui-input-inline" style="width: 100px;">
                        <input value="${recouponsVo.startdate}" name="couponsVo.startdate" class="layui-input" placeholder="起始日期" onclick="layui.laydate({elem: this, festival: true})">
                    </div>
                    <div class="layui-form-mid">:</div>
                    <div class="layui-input-inline" style="width: 100px;">
                        <input value="${recouponsVo.enddate}" name="couponsVo.enddate" class="layui-input" placeholder="结束日期" onclick="layui.laydate({elem: this, festival: true})">
                    </div>
                </div>&nbsp;
                <input type="submit" id="search" class="layui-btn layui-btn-normal btn-search" value="搜索">
            </div>
        </form>
    </legend>
</fieldset>

<div class="layui-form" id="cp">
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col width="150">
            <col width="100">
            <col width="100">
            <col width="100">
            <col width="150">
            <col width="100">
            <col width="150">
            <col width="100">
        </colgroup>
        <thead>
        <tr>
            <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></th>
            <th>优惠券ID</th>
            <th>名称</th>
            <th>价值</th>
            <th>限额</th>
            <th>详细描述</th>
            <th>发放状态</th>
            <th>优惠券截止日期</th>
            <th>优惠券数量</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${croCoupons}" var="coupons" varStatus="i">
            <tr>
                <td><input type="checkbox" name="cb" lay-skin="primary" value="${coupons.id}"></td>
                <td>${coupons.id}</td>
                <td>${SysDict['cropons_type'][coupons.type]}</td>
                <td>${coupons.value}</td>
                <td>${coupons.uplimit}</td>
                <td>${coupons.description}</td>
                <td>${SysDict['cropons_status'][coupons.status]}</td>
                <td>${coupons.offdate}</td>
                <td>${coupons.number}</td>
                <td><a data-method="issue" id="couponsid" couponsid="${coupons.id}" cstatus="${SysDict['cropons_status'][coupons.status]}" class="layui-btn layui-btn-small couponssumit" >发放</a>
                    <a data-method="update" id="updatesumit" couponsid="${coupons.id}" class="layui-btn layui-btn-small updatesumit">更新</a>
                    <a data-method="delete" id="delsumit" couponsid="${coupons.id}" class="layui-btn layui-btn-small delsumit" >删除</a>
                </td>

            </tr>
        </c:forEach>
        </tbody>
    </table>

    <form id="issuecoupons" class="layui-form" hidden>
        <br>
        <div class="layui-form-item">
            <label class="layui-form-label">订单ID</label>
            <div class="layui-input-block">
                <input disabled type="text" id="cpid" name="cpid"  required  lay-verify="required" autocomplete="off" class="layui-input" style="width: 95%">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input disabled type="text" id="status" name="status"  required  lay-verify="required"  autocomplete="off" class="layui-input" style="width: 95%">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">截止时间</label>
            <div class="layui-input-block">
                <input class="layui-input" placeholder="到期时间" id="LAY_demorange_s"
                       onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">发放数量</label>
            <div class="layui-input-block">
                <input type="text" id="number" name="number"  required  lay-verify="required"  autocomplete="off" class="layui-input" style="width: 95%">
            </div>
        </div>
    </form>
</div>
<%--分页显示区域--%>
<div id="fullpage"></div>
